#!/bin/bash


export PATH=/usr/bin:/bin

if [ $# -eq 0 ]; then
        echo -e "\nUsage:	$(basename $0) command [options]\n"
        exit 1
fi

mycommand=""
while [ "$1" != "" ]; do
	if [ "X${mycommand}" == "X" ]; then
		mycommand="$1"
	else 
		mycommand="${mycommand} $1"
	fi
	shift
done


. /etc/named/IT_DNS_SERVERS

for server in $(echo $DNS_PRIMARY_MASTER $DNS_PSEUDO_MASTERS $DNS_SLAVES); do
	echo -e "\n\nPerforming \"$mycommand\" on $server..."
	ssh $server "$mycommand"
done
